package com.qm.console.pubdef.pubenum;


/**
 * @author ywxie
 * @date 2020/1/20 11:05
 * @description 大神限制状态
 */
public enum GodRestrictStateEnum {

    Authenticated(0, 1),
    Forbid_Auth(1, 1),
    Allow_Order(2, 2),
    Not_Allow_Order(3, 2),
    ;

    private Integer restrictState;
    private Integer forbidCategory;

    GodRestrictStateEnum(Integer restrictState, Integer forbidCategory) {
        this.restrictState = restrictState;
        this.forbidCategory = forbidCategory;
    }

    public Integer getRestrictState() {
        return restrictState;
    }

    public Integer getForbidCategory() {
        return forbidCategory;
    }

    public static GodRestrictStateEnum getGodRestrictStateEnumByRestrictState(Integer restrictState){
        for(GodRestrictStateEnum restrictStateEnum: values()){
            if(restrictStateEnum.getRestrictState().equals(restrictState)){
                return restrictStateEnum;
            }
        }
        return null;
    }

    public static GodStateEnum getGodStateEnumByGodRestrictState(GodRestrictStateEnum restrictStateEnum){
        if (GodRestrictStateEnum.Authenticated.equals(restrictStateEnum)){
            return GodStateEnum.Normal;
        }else if (GodRestrictStateEnum.Forbid_Auth.equals(restrictStateEnum)){
            return GodStateEnum.Forbid_Auth;
        }
        return null;
    }

    public static SkillForbidFlagEnum getSkillForbidFlagEnumByGodRestrictState(Integer restrictState){
        for(GodRestrictStateEnum restrictStateEnum: values()){
            if(restrictStateEnum.getRestrictState().equals(restrictState)){
                if (GodRestrictStateEnum.Allow_Order.equals(restrictStateEnum)){
                    return SkillForbidFlagEnum.Normal;
                }else if (GodRestrictStateEnum.Not_Allow_Order.equals(restrictStateEnum)){
                    return SkillForbidFlagEnum.Forbid_Order;
                }
            }
        }
        return null;
    }
}
